﻿using Abp.Auditing;
using Abp.NHibernate.EntityMappings;
using Akso.Authorization.Users;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Akso.NHibernate.EntityMappings
{
    /// <summary>
    /// Define mapping between <see cref="AuditLogs"/> entity and "AbpAuditLogs" table using FluentNHibernate.
    /// 
    /// Inherits from <see cref="EntityMap{TEntity,TPrimaryKey}"/>.
    /// EntityMap gets table name in it's constructor and automatically maps Id property. So, we do not map Id again.
    /// </summary>
    public class AuditLogsMap : EntityMap<AuditLog, long>
    {
        public AuditLogsMap() : base("AbpAuditLogs")
        {
            Id(x => x.Id);
            Map(x => x.BrowserInfo);
            Map(x => x.ClientIpAddress);
            Map(x => x.ClientName);
            Map(x => x.CustomData);
            Map(x => x.Exception);
            Map(x => x.ExecutionDuration);
            Map(x => x.ExecutionTime);
            Map(x => x.ImpersonatorTenantId);
            Map(x => x.ImpersonatorUserId);
            Map(x => x.MethodName);
            Map(x => x.Parameters);
            Map(x => x.ServiceName);
            Map(x => x.TenantId);
            Map(x => x.UserId);
            //References(x => x.AssignedPerson).Column("AssignedPersonId").LazyLoad();
        }
    }
}
